function roseDSpt(hax,f,th,s,T,H,D,stype,dtype)
% function roseDSpt(hax,f,th,s,T,H,stype,dtype)
      switch dtype
      case 'met-N'
            u=f.*cos(pi/2-th);
            v=f.*sin(pi/2-th);
      case 'flo-E'
            u=f.*cos(th);
            v=f.*sin(th);
      end
      dth=th(2)-th(1);
      axes(hax);
	     nlev=50; ndel=0.3; ndel=floor(ndel*nlev);
      switch stype
      case 'solid', surf(u,v,s); shading interp; view(2);
      case 'wire', [cl,hl]=contour(u,v,s,nlev);
      end 

      cmap=jet(nlev+ndel); colormap(cmap(ndel+1:nlev+ndel,:))
      view(2); axis off; 
      hold on; polarFrame3(gca,max(max(f)),max(max(s)));
      txt=sprintf('Hs=%2.1f m; Tp=%2.1f s; \\theta=%3.1f deg.',H,T,D);
      v=axis; 
      text(0.5*(v(1)+v(2)),1.1*v(4),txt,'fontsi',12,'horiz','c');
      
      
function polarFrame3(axHandle,Rad,zplane)
% Alexandru Sheremet, May 2001
      axes(axHandle);
      winds={'N','','NE','','E','','SE','','S','','SW','','W','','NW',''};
      alpha=(0:22.5:337.5);alpha=(ones(size(alpha))*90-alpha)*pi/180;	
      nR=floor(Rad/0.05); rad=nR*0.05; 
      RR=[0.01,0.1:0.1:rad,Rad];
      theta=(0:2*pi/1000:2*pi);
      R=max(RR); 
	
      xcircle=cos(theta(:))*RR; ycircle=sin(theta(:))*RR; zcircle=ones(size(xcircle))*zplane;
      set(plot3(xcircle,ycircle,zcircle),'color','k');
      axis([-1.2*R,1.2*R,-1.2*R,1.2*R]);
      axis equal; hold on;
      axis off;

      for k=1:length(alpha)
            set(plot3([0,R*cos(alpha(k))],[0,R*sin(alpha(k))],[zplane,zplane]),'linewidth',0.1,'col','k');
	     if cos(alpha(k))<0 
	     	    text(1.1*R*cos(alpha(k)),1.1*R*sin(alpha(k)),zplane,winds{k},...
		    'fontw','b','fontsi',10,'Hor','right');
	     else
	     	    text(1.1*R*cos(alpha(k)),1.1*R*sin(alpha(k)),zplane,winds{k},...
		    'fontw','b','fontsi',10,'Hor','left');
	     end
      end
      for k=1:length(RR)-1
		text(-0.01,RR(k),zplane,num2str(RR(k),4),'fontsi',8,'hor','r',...
			'vert','bottom');
      end;

